namespace ScrumSprintMonitor.Infrastructure.Configuration
{
	#region #using Directives

	using System;

	#endregion

	public static class SprintConfigurationExtensions
	{
		public static DateTime GetLocalSprintStartDate(this ISprintConfiguration sprintConfiguration)
		{
			return
				new DateTime(TimeZoneInfo.ConvertTime(sprintConfiguration.SprintStartDate, sprintConfiguration.SprintStartTimeZone, TimeZoneInfo.Local).Ticks,
				             DateTimeKind.Local);
		}

		public static DateTime GetLocalSprintEndDate(this ISprintConfiguration sprintConfiguration)
		{
			return new DateTime(TimeZoneInfo.ConvertTime(sprintConfiguration.SprintEndDate, sprintConfiguration.SprintEndTimeZone, TimeZoneInfo.Local).Ticks,
			                    DateTimeKind.Local);
		}
	}
}